#pragma once
// MESSAGE POD_1658_UPDATE_SLOW_DOWN_STATE PACKING

#define TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE 11658

TTAPACKED(
typedef struct __ttalink_pod_1658_update_slow_down_state_t {
 uint8_t ack; /*< light 0~100*/
 int8_t speed; /*< 0=puase , -100~100%speed.*/
 uint8_t unhook; /*< 0=close 1=open*/
 uint8_t point; /*< 0=close 1=open*/
 uint8_t reserve1; /*<  预留*/
}) ttalink_pod_1658_update_slow_down_state_t;

#define TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN 5
#define TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN 5
#define TTALINK_MSG_ID_11658_LEN 5
#define TTALINK_MSG_ID_11658_MIN_LEN 5

#define TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC 209
#define TTALINK_MSG_ID_11658_CRC 209



#if TTALINK_COMMAND_24BIT
#define TTALINK_MESSAGE_INFO_POD_1658_UPDATE_SLOW_DOWN_STATE { \
    11658, \
    "POD_1658_UPDATE_SLOW_DOWN_STATE", \
    5, \
    {  { "ack", NULL, TTALINK_TYPE_UINT8_T, 0, 0, offsetof(ttalink_pod_1658_update_slow_down_state_t, ack) }, \
         { "speed", NULL, TTALINK_TYPE_INT8_T, 0, 1, offsetof(ttalink_pod_1658_update_slow_down_state_t, speed) }, \
         { "unhook", NULL, TTALINK_TYPE_UINT8_T, 0, 2, offsetof(ttalink_pod_1658_update_slow_down_state_t, unhook) }, \
         { "point", NULL, TTALINK_TYPE_UINT8_T, 0, 3, offsetof(ttalink_pod_1658_update_slow_down_state_t, point) }, \
         { "reserve1", NULL, TTALINK_TYPE_UINT8_T, 0, 4, offsetof(ttalink_pod_1658_update_slow_down_state_t, reserve1) }, \
         } \
}
#else
#define TTALINK_MESSAGE_INFO_POD_1658_UPDATE_SLOW_DOWN_STATE { \
    "POD_1658_UPDATE_SLOW_DOWN_STATE", \
    5, \
    {  { "ack", NULL, TTALINK_TYPE_UINT8_T, 0, 0, offsetof(ttalink_pod_1658_update_slow_down_state_t, ack) }, \
         { "speed", NULL, TTALINK_TYPE_INT8_T, 0, 1, offsetof(ttalink_pod_1658_update_slow_down_state_t, speed) }, \
         { "unhook", NULL, TTALINK_TYPE_UINT8_T, 0, 2, offsetof(ttalink_pod_1658_update_slow_down_state_t, unhook) }, \
         { "point", NULL, TTALINK_TYPE_UINT8_T, 0, 3, offsetof(ttalink_pod_1658_update_slow_down_state_t, point) }, \
         { "reserve1", NULL, TTALINK_TYPE_UINT8_T, 0, 4, offsetof(ttalink_pod_1658_update_slow_down_state_t, reserve1) }, \
         } \
}
#endif


static inline uint16_t _ttalink_pod_1658_update_slow_down_state_pack(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t* msg,
                               uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1, bool nocrc)
{
#if TTALINK_NEED_BYTE_SWAP || !TTALINK_ALIGNED_FIELDS
    char buf[TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN];
    _tta_put_uint8_t(buf, 0, ack);
    _tta_put_int8_t(buf, 1, speed);
    _tta_put_uint8_t(buf, 2, unhook);
    _tta_put_uint8_t(buf, 3, point);
    _tta_put_uint8_t(buf, 4, reserve1);

        memcpy(_TTA_PAYLOAD_NON_CONST(msg), buf, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN);
#else
    ttalink_pod_1658_update_slow_down_state_t packet;
    packet.ack = ack;
    packet.speed = speed;
    packet.unhook = unhook;
    packet.point = point;
    packet.reserve1 = reserve1;

        memcpy(_TTA_PAYLOAD_NON_CONST(msg), &packet, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN);
#endif

    msg->msgid = TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE;
    return ttalink_finalize_message(msg, dst_addr, src_addr, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
}

/**
 * @brief Pack a pod_1658_update_slow_down_state message
 * @param dst_addr 
 * @param src_addr
 * @param msg The TTAlink message to compress the data into
 *
 * @param ack light 0~100
 * @param speed 0=puase , -100~100%speed.
 * @param unhook 0=close 1=open
 * @param point 0=close 1=open
 * @param reserve1  预留
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_pack(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t* msg,
                               uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1)
{
    return _ttalink_pod_1658_update_slow_down_state_pack(dst_addr, src_addr, msg,  ack, speed, unhook, point, reserve1, false);
}

/**
 * @brief Pack a pod_1658_update_slow_down_state message, no crc
 * @param dst_addr 
 * @param src_addr
 * @param msg The TTAlink message to compress the data into
 *
 * @param ack light 0~100
 * @param speed 0=puase , -100~100%speed.
 * @param unhook 0=close 1=open
 * @param point 0=close 1=open
 * @param reserve1  预留
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_pack_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t* msg,
                               uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1)
{
    return _ttalink_pod_1658_update_slow_down_state_pack(dst_addr, src_addr, msg,  ack, speed, unhook, point, reserve1, true);
}


static inline uint16_t _ttalink_pod_1658_update_slow_down_state_pack_chan(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan,
                               ttalink_message_t* msg,
                                   uint8_t ack,int8_t speed,uint8_t unhook,uint8_t point,uint8_t reserve1, bool nocrc)
{
#if TTALINK_NEED_BYTE_SWAP || !TTALINK_ALIGNED_FIELDS
    char buf[TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN];
    _tta_put_uint8_t(buf, 0, ack);
    _tta_put_int8_t(buf, 1, speed);
    _tta_put_uint8_t(buf, 2, unhook);
    _tta_put_uint8_t(buf, 3, point);
    _tta_put_uint8_t(buf, 4, reserve1);

        memcpy(_TTA_PAYLOAD_NON_CONST(msg), buf, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN);
#else
    ttalink_pod_1658_update_slow_down_state_t packet;
    packet.ack = ack;
    packet.speed = speed;
    packet.unhook = unhook;
    packet.point = point;
    packet.reserve1 = reserve1;

        memcpy(_TTA_PAYLOAD_NON_CONST(msg), &packet, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN);
#endif

    msg->msgid = TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE;
    return ttalink_finalize_message_chan(msg, dst_addr, src_addr, chan, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
}

/**
 * @brief Pack a pod_1658_update_slow_down_state message on a channel
 * @param dst_addr ID of this system
 * @param src_addr ID of this component (e.g. 200 for IMU)
 * @param chan The TTAlink channel this message will be sent over
 * @param msg The TTAlink message to compress the data into
 * @param ack light 0~100
 * @param speed 0=puase , -100~100%speed.
 * @param unhook 0=close 1=open
 * @param point 0=close 1=open
 * @param reserve1  预留
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_pack_chan(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan,
                               ttalink_message_t* msg,
                                   uint8_t ack,int8_t speed,uint8_t unhook,uint8_t point,uint8_t reserve1)
{
    return _ttalink_pod_1658_update_slow_down_state_pack_chan(dst_addr, src_addr, chan, msg,  ack, speed, unhook, point, reserve1, false);
}

/**
 * @brief Pack a pod_1658_update_slow_down_state message on a channel, no crc
 * @param dst_addr ID of this system
 * @param src_addr ID of this component (e.g. 200 for IMU)
 * @param chan The TTAlink channel this message will be sent over
 * @param msg The TTAlink message to compress the data into
 * @param ack light 0~100
 * @param speed 0=puase , -100~100%speed.
 * @param unhook 0=close 1=open
 * @param point 0=close 1=open
 * @param reserve1  预留
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_pack_chan_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan,
                               ttalink_message_t* msg,
                                   uint8_t ack,int8_t speed,uint8_t unhook,uint8_t point,uint8_t reserve1)
{
    return _ttalink_pod_1658_update_slow_down_state_pack_chan(dst_addr, src_addr, chan, msg,  ack, speed, unhook, point, reserve1, true);
}


static inline uint16_t _ttalink_pod_1658_update_slow_down_state_encode(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t* msg, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state, bool nocrc)
{
    if(nocrc){
        return ttalink_pod_1658_update_slow_down_state_pack_nocrc(dst_addr, src_addr, msg, pod_1658_update_slow_down_state->ack, pod_1658_update_slow_down_state->speed, pod_1658_update_slow_down_state->unhook, pod_1658_update_slow_down_state->point, pod_1658_update_slow_down_state->reserve1);
    }else{
        return ttalink_pod_1658_update_slow_down_state_pack(dst_addr, src_addr, msg, pod_1658_update_slow_down_state->ack, pod_1658_update_slow_down_state->speed, pod_1658_update_slow_down_state->unhook, pod_1658_update_slow_down_state->point, pod_1658_update_slow_down_state->reserve1);
    }
    
}

/**
 * @brief Encode a pod_1658_update_slow_down_state struct
 *
 * @param dst_addr ID of this system
 * @param src_addr ID of this component (e.g. 200 for IMU)
 * @param msg The TTAlink message to compress the data into
 * @param pod_1658_update_slow_down_state C-struct to read the message contents from
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_encode(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t* msg, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
    return _ttalink_pod_1658_update_slow_down_state_encode(dst_addr, src_addr, msg, pod_1658_update_slow_down_state, false);
}

/**
 * @brief Encode a pod_1658_update_slow_down_state struct, no crc
 *
 * @param dst_addr ID of this system
 * @param src_addr ID of this component (e.g. 200 for IMU)
 * @param msg The TTAlink message to compress the data into
 * @param pod_1658_update_slow_down_state C-struct to read the message contents from
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_encode_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t* msg, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
    return _ttalink_pod_1658_update_slow_down_state_encode(dst_addr, src_addr, msg, pod_1658_update_slow_down_state, true);
}


static inline uint16_t _ttalink_pod_1658_update_slow_down_state_encode_chan(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, ttalink_message_t* msg, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state, bool nocrc)
{
    if(nocrc){
        return ttalink_pod_1658_update_slow_down_state_pack_chan_nocrc(dst_addr, src_addr, chan, msg, pod_1658_update_slow_down_state->ack, pod_1658_update_slow_down_state->speed, pod_1658_update_slow_down_state->unhook, pod_1658_update_slow_down_state->point, pod_1658_update_slow_down_state->reserve1);
    }else{
        return ttalink_pod_1658_update_slow_down_state_pack_chan(dst_addr, src_addr, chan, msg, pod_1658_update_slow_down_state->ack, pod_1658_update_slow_down_state->speed, pod_1658_update_slow_down_state->unhook, pod_1658_update_slow_down_state->point, pod_1658_update_slow_down_state->reserve1);
    }
}

/**
 * @brief Encode a pod_1658_update_slow_down_state struct on a channel
 *
 * @param dst_addr ID of this system
 * @param src_addr ID of this component (e.g. 200 for IMU)
 * @param chan The TTAlink channel this message will be sent over
 * @param msg The TTAlink message to compress the data into
 * @param pod_1658_update_slow_down_state C-struct to read the message contents from
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_encode_chan(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, ttalink_message_t* msg, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
    return _ttalink_pod_1658_update_slow_down_state_encode_chan(dst_addr, src_addr, chan, msg, pod_1658_update_slow_down_state, false);
}

/**
 * @brief Encode a pod_1658_update_slow_down_state struct on a channel, no crc
 *
 * @param dst_addr ID of this system
 * @param src_addr ID of this component (e.g. 200 for IMU)
 * @param chan The TTAlink channel this message will be sent over
 * @param msg The TTAlink message to compress the data into
 * @param pod_1658_update_slow_down_state C-struct to read the message contents from
 */
static inline uint16_t ttalink_pod_1658_update_slow_down_state_encode_chan_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, ttalink_message_t* msg, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
    return _ttalink_pod_1658_update_slow_down_state_encode_chan(dst_addr, src_addr, chan, msg, pod_1658_update_slow_down_state, true);
}


#ifdef TTALINK_USE_CONVENIENCE_FUNCTIONS

static inline void _ttalink_pod_1658_update_slow_down_state_send(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1, bool nocrc)
{
#if TTALINK_NEED_BYTE_SWAP || !TTALINK_ALIGNED_FIELDS
    char buf[TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN];
    _tta_put_uint8_t(buf, 0, ack);
    _tta_put_int8_t(buf, 1, speed);
    _tta_put_uint8_t(buf, 2, unhook);
    _tta_put_uint8_t(buf, 3, point);
    _tta_put_uint8_t(buf, 4, reserve1);

    _tta_finalize_message_chan_send(dst_addr, src_addr, chan, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE, buf, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
#else
    ttalink_pod_1658_update_slow_down_state_t packet;
    packet.ack = ack;
    packet.speed = speed;
    packet.unhook = unhook;
    packet.point = point;
    packet.reserve1 = reserve1;

    _tta_finalize_message_chan_send(dst_addr, src_addr, chan, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE, (const char *)&packet, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
#endif
}

/**
 * @brief Send a pod_1658_update_slow_down_state message
 * @param chan TTAlink channel to send the message
 *
 * @param ack light 0~100
 * @param speed 0=puase , -100~100%speed.
 * @param unhook 0=close 1=open
 * @param point 0=close 1=open
 * @param reserve1  预留
 */
static inline void ttalink_pod_1658_update_slow_down_state_send(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1)
{
    _ttalink_pod_1658_update_slow_down_state_send(dst_addr, src_addr, chan, ack, speed, unhook, point, reserve1, false);
}

/**
 * @brief Send a pod_1658_update_slow_down_state message, no crc
 * @param chan TTAlink channel to send the message
 *
 * @param ack light 0~100
 * @param speed 0=puase , -100~100%speed.
 * @param unhook 0=close 1=open
 * @param point 0=close 1=open
 * @param reserve1  预留
 */
static inline void ttalink_pod_1658_update_slow_down_state_send_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1)
{
    _ttalink_pod_1658_update_slow_down_state_send(dst_addr, src_addr, chan, ack, speed, unhook, point, reserve1, true);
}


static inline void _ttalink_pod_1658_update_slow_down_state_send_struct(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state, bool nocrc)
{
#if TTALINK_NEED_BYTE_SWAP || !TTALINK_ALIGNED_FIELDS
    if(nocrc){
        ttalink_pod_1658_update_slow_down_state_send_nocrc(dst_addr, src_addr, chan, pod_1658_update_slow_down_state->ack, pod_1658_update_slow_down_state->speed, pod_1658_update_slow_down_state->unhook, pod_1658_update_slow_down_state->point, pod_1658_update_slow_down_state->reserve1);
    }else{
        ttalink_pod_1658_update_slow_down_state_send(dst_addr, src_addr, chan, pod_1658_update_slow_down_state->ack, pod_1658_update_slow_down_state->speed, pod_1658_update_slow_down_state->unhook, pod_1658_update_slow_down_state->point, pod_1658_update_slow_down_state->reserve1);
    }
#else
    _tta_finalize_message_chan_send(dst_addr, src_addr, chan, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE, (const char *)pod_1658_update_slow_down_state, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
#endif
}

/**
 * @brief Send a pod_1658_update_slow_down_state message
 * @param chan TTAlink channel to send the message
 * @param struct The TTAlink struct to serialize
 */
static inline void ttalink_pod_1658_update_slow_down_state_send_struct(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
    _ttalink_pod_1658_update_slow_down_state_send_struct(dst_addr, src_addr, chan, pod_1658_update_slow_down_state, false);
}

/**
 * @brief Send a pod_1658_update_slow_down_state message, no crc
 * @param chan TTAlink channel to send the message
 * @param struct The TTAlink struct to serialize
 */
static inline void ttalink_pod_1658_update_slow_down_state_send_struct_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_channel_t chan, const ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
    _ttalink_pod_1658_update_slow_down_state_send_struct(dst_addr, src_addr, chan, pod_1658_update_slow_down_state, true);
}

#if TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN <= TTALINK_MAX_PAYLOAD_LEN
static inline void _ttalink_pod_1658_update_slow_down_state_send_buf(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t *msgbuf, ttalink_channel_t chan,  uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1, bool nocrc)
{
#if TTALINK_NEED_BYTE_SWAP || !TTALINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _tta_put_uint8_t(buf, 0, ack);
    _tta_put_int8_t(buf, 1, speed);
    _tta_put_uint8_t(buf, 2, unhook);
    _tta_put_uint8_t(buf, 3, point);
    _tta_put_uint8_t(buf, 4, reserve1);

    _tta_finalize_message_chan_send(dst_addr, src_addr, chan, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE, buf, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
#else
    ttalink_pod_1658_update_slow_down_state_t *packet = (ttalink_pod_1658_update_slow_down_state_t *)msgbuf;
    packet->ack = ack;
    packet->speed = speed;
    packet->unhook = unhook;
    packet->point = point;
    packet->reserve1 = reserve1;

    _tta_finalize_message_chan_send(dst_addr, src_addr, chan, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE, (const char *)packet, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_MIN_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_CRC, nocrc);
#endif
}

/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  ttalink_message_t which is the size of a full ttalink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void ttalink_pod_1658_update_slow_down_state_send_buf(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t *msgbuf, ttalink_channel_t chan,  uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1)
{
    _ttalink_pod_1658_update_slow_down_state_send_buf(dst_addr, src_addr, msgbuf, chan, ack, speed, unhook, point, reserve1, false);
}

/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  ttalink_message_t which is the size of a full ttalink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage, no crc.
 */
static inline void ttalink_pod_1658_update_slow_down_state_send_buf_nocrc(uint8_t dst_addr, uint8_t src_addr, ttalink_message_t *msgbuf, ttalink_channel_t chan,  uint8_t ack, int8_t speed, uint8_t unhook, uint8_t point, uint8_t reserve1)
{
    _ttalink_pod_1658_update_slow_down_state_send_buf(dst_addr, src_addr, msgbuf, chan, ack, speed, unhook, point, reserve1, true);
}
#endif

#endif

// MESSAGE POD_1658_UPDATE_SLOW_DOWN_STATE UNPACKING


/**
 * @brief Get field ack from pod_1658_update_slow_down_state message
 *
 * @return light 0~100
 */
static inline uint8_t ttalink_pod_1658_update_slow_down_state_get_ack(const ttalink_message_t* msg)
{
    return _TTA_RETURN_uint8_t(msg,  0);
}

/**
 * @brief Get field speed from pod_1658_update_slow_down_state message
 *
 * @return 0=puase , -100~100%speed.
 */
static inline int8_t ttalink_pod_1658_update_slow_down_state_get_speed(const ttalink_message_t* msg)
{
    return _TTA_RETURN_int8_t(msg,  1);
}

/**
 * @brief Get field unhook from pod_1658_update_slow_down_state message
 *
 * @return 0=close 1=open
 */
static inline uint8_t ttalink_pod_1658_update_slow_down_state_get_unhook(const ttalink_message_t* msg)
{
    return _TTA_RETURN_uint8_t(msg,  2);
}

/**
 * @brief Get field point from pod_1658_update_slow_down_state message
 *
 * @return 0=close 1=open
 */
static inline uint8_t ttalink_pod_1658_update_slow_down_state_get_point(const ttalink_message_t* msg)
{
    return _TTA_RETURN_uint8_t(msg,  3);
}

/**
 * @brief Get field reserve1 from pod_1658_update_slow_down_state message
 *
 * @return  预留
 */
static inline uint8_t ttalink_pod_1658_update_slow_down_state_get_reserve1(const ttalink_message_t* msg)
{
    return _TTA_RETURN_uint8_t(msg,  4);
}

/**
 * @brief Decode a pod_1658_update_slow_down_state message into a struct
 *
 * @param msg The message to decode
 * @param pod_1658_update_slow_down_state C-struct to decode the message contents into
 */
static inline void ttalink_pod_1658_update_slow_down_state_decode(const ttalink_message_t* msg, ttalink_pod_1658_update_slow_down_state_t* pod_1658_update_slow_down_state)
{
#if TTALINK_NEED_BYTE_SWAP || !TTALINK_ALIGNED_FIELDS
    pod_1658_update_slow_down_state->ack = ttalink_pod_1658_update_slow_down_state_get_ack(msg);
    pod_1658_update_slow_down_state->speed = ttalink_pod_1658_update_slow_down_state_get_speed(msg);
    pod_1658_update_slow_down_state->unhook = ttalink_pod_1658_update_slow_down_state_get_unhook(msg);
    pod_1658_update_slow_down_state->point = ttalink_pod_1658_update_slow_down_state_get_point(msg);
    pod_1658_update_slow_down_state->reserve1 = ttalink_pod_1658_update_slow_down_state_get_reserve1(msg);
#else
        uint8_t len = msg->len < TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN? msg->len : TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN;
        memset(pod_1658_update_slow_down_state, 0, TTALINK_MSG_ID_POD_1658_UPDATE_SLOW_DOWN_STATE_LEN);
    memcpy(pod_1658_update_slow_down_state, _TTA_PAYLOAD(msg), len);
#endif
}
